//
//  SNCompilePlanTopView.m
//  ZhuoxinAgriculture
//
//  Created by stone on 16/12/25.
//  Copyright © 2016年 stone. All rights reserved.
//

#import "SNCompilePlanTopView.h"
#import "SNPlanListViewController.h"
@interface SNCompilePlanTopView ()

@property (weak, nonatomic) IBOutlet UIImageView *iconImageView;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;

@end

@implementation SNCompilePlanTopView

- (void)setModel:(SNPlanListModel *)model{
    _model = model;

    // 个人查询 (业务代表查询属下的暂时不管)
    self.nameLabel.text = [NSString stringWithFormat:@"%@|%@",kUserInfo.userName,model.fullName];
}
-(void)setPlantingDecisionMakerResult:(SNPlantingDecisionMakerResult *)plantingDecisionMakerResult{
    _plantingDecisionMakerResult = plantingDecisionMakerResult;
    self.nameLabel.text = [NSString stringWithFormat:@"%@ | %@",plantingDecisionMakerResult.custName,plantingDecisionMakerResult.fullName];
    [SNUtils getImageWithURLString:plantingDecisionMakerResult.photo imageView:self.iconImageView];
}
-(void)awakeFromNib{
    [super awakeFromNib];
    dispatch_async(dispatch_get_main_queue(), ^{
        self.iconImageView.layer.cornerRadius = self.iconImageView.bounds.size.width * 0.5;
        self.iconImageView.layer.masksToBounds = YES;
        
    });
}
@end
